
(defun c:todo ( )
;;;  (if (ssget "x" '((-4 . "<OR")(2 . "B")(2 . "B1")(-4 . "OR>")))
;;;    (VL-BB-SET 'edfiles-list (APPEND (VL-BB-REF 'edfiles-list) (list (VL-BB-REF 'fn))))
;;;  )
;;;  (IF (VL-BB-REF 'prev-object) (vla-close (VL-BB-REF 'prev-object)))
;;;  (VL-BB-SET 'prev-object (VL-BB-REF 'next-object))
;;;  (VL-BB-SET 'files-list (dos_find (strcat (getvar "dwgprefix") "..\\?-*.dwg")))
  (VL-BB-SET 'this-object (VLAX-GET-PROPERTY (VLAX-GET-ACAD-OBJECT) "ActiveDocument"))
  (VL-BB-SET 'this-drawing (VLAX-GET-PROPERTY (VL-BB-REF 'this-object) "FullName"))
  (IF (VL-BB-REF 'files-list)
    (VL-BB-SET 'fn (CAR (VL-BB-REF 'files-list)))
    (VL-BB-SET 'fn NIL)
  )
  (IF (<= (LENGTH (VL-BB-REF 'files-list)) 1)
    (VL-BB-SET 'files-list NIL)
    (VL-BB-SET 'files-list (CDR (VL-BB-REF 'files-list)))
  )
  (PRINC "\n")
    (IF (VL-BB-REF 'files-list)
      (PRINC (LENGTH (VL-BB-REF 'files-list)))
      (PRINC "No")
    )
  )
  (PRINC " files remain to be opened. ")
  (PRINC)
    (IF (AND (VL-BB-REF 'fn)(WCMATCH (STRCASE (VL-BB-REF 'fn)) "*\\@-#*.DWG") (/= (VL-BB-REF 'fn) (VL-BB-REF 'this-drawing)))
      (PROGN
        ;(command "._VBASTMT" "ThisDrawing.Application.ActiveDocument.Close(vbFalse)")
        (vla-activate (VL-BB-SET 'next-object (vla-open (vla-get-documents (vlax-get-acad-object)) (VL-BB-REF 'fn))));opens and activates drawing file n
;;;	(vla-activate (vla-get-documents (vlax-get-acad-object)) this-drawing);activates the drawing file we started from
;;;	(IF (EQ n (VLAX-GET-PROPERTY (VLAX-GET-PROPERTY (VLAX-GET-ACAD-OBJECT) "ActiveDocument") "FullName"));full path filename of active document
;;;	(vlax-for DocObj (VLAX-GET (VLAX-GET-ACAD-OBJECT) 'Documents)(PRINC "\n")(PRINC (VLAX-GET-PROPERTY DocObj "FullName"))(PRINC))
      )
    )
  (PRINC)
)
(defun c:modo ( / open-list)
  (vlax-for DocObj (VLAX-GET (VLAX-GET-ACAD-OBJECT) 'Documents)(SETQ open-list (append open-list (list (VLAX-GET-PROPERTY DocObj "FullName")))))
  (IF (> (LENGTH open-list) 1)
    (vla-activate (vla-item (vla-get-documents (vlax-get-acad-object)) (CAR (REVERSE (DOS_SPLITPATH (NTH 1 open-list))))))
  )
;;;  (if (ssget "x" '((-4 . "<OR")(2 . "B")(2 . "B1")(-4 . "OR>")))
;;;    (VL-BB-SET 'edfiles-list (APPEND (VL-BB-REF 'edfiles-list) (list (VL-BB-REF 'fn))))
;;;  )
;;;  (IF (VL-BB-REF 'prev-object) (vla-close (VL-BB-REF 'prev-object)))
;;;  (VL-BB-SET 'prev-object (VL-BB-REF 'next-object))
;;;  (VL-BB-SET 'files-list (CDR (VL-BB-REF 'files-list)))
;;;  (vla-close (VL-BB-REF 'next-object) :vlax-true)
;;;  (vlax-release-object (VL-BB-REF 'next-object))
  (PRINC)
)
;;;(VL-BB-SET 'files-list
;;;       '(
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\03 Structural\\S-12 CASCADE AERATOR & LEVEL SPREADER PLAN.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\03 Structural\\S-13 CASCADE AERATOR & LEVEL SPREADER SECTIONS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\03 Structural\\S-4 SEQUENCING BATCH REACTOR LAYOUT PLAN.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\03 Structural\\S-5 SEQUENCING BATCH REACTOR SECTIONS AND DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\03 Structural\\S-5 SEQUENCING BATCH REACTOR SECTIONS AND DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\03 Structural\\S-6 SEQUENCING BATCH REACTOR DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\03 Structural\\S-7 FILTER AND BACKWASH WASTE PUMP STATION PLAN.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\03 Structural\\S-8 FILTER SECTION.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\03 Structural\\S-9 FILTER SECTIONS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\04 Architectural\\A-1 OPERATIONS BUILDING PLAN.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\04 Architectural\\A-2 OPERATIONS BUILDING SECTION.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\04 Architectural\\A-3 OPERATIONS BUILDING DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\04 Architectural\\A-4 OPERATIONS BUILDING CABINETRY.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\09 Mechanical\\M-10 SEQUENCING BATCH REACTOR DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\09 Mechanical\\M-16 SLUDGE DIGESTER PLAN AND DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\09 Mechanical\\M-17 SLUDGE DIGESTER SECTIONS AND DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\09 Mechanical\\M-18 SLUDGE PUMP AND PLATFORM DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\09 Mechanical\\M-19 SLUDGE LOADING STATION DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\09 Mechanical\\M-2 HEADWORKS SECTION AND DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\09 Mechanical\\M-20 BLOWER CLUSTER PLAN.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\09 Mechanical\\M-21 BLOWER CLUSTER SECTIONS AND DETAILS.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\09 Mechanical\\M-22 BLOWER CLUSTER SECTION.dwg"
;;;"H:\\HC1116\\800 Drawings\\810 Design Drawings\\09 Mechanical\\M-5 SPLITTER BOX PLAN AND SECTIONS.dwg"
;;;	 ))
;;;(vl-load-com) ; load ActiveX support
;;;(vlax-for for-item
;;;          (vla-get-documents (vlax-get-acad-object))
;;;          (vla-open for-item)
;;;)